package com.neusoft.databus.sap.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.bizcore.web.dto.result.ResultDTO;
import com.neusoft.databus.agent.interactive.service.CollectorService;
import com.neusoft.databus.common.bean.CommandBean;
import com.neusoft.databus.core.service.ExecuteCollectService;

@Service
public class ExecuteCollectServiceImpl implements ExecuteCollectService {

    @Autowired
    private CollectorService collectorService;

    @Override
    public ResultDTO<CommandBean> collect(CommandBean command, String stateIdentifier) throws Exception {
        final CommandBean commandResult = this.collectorService.collect(command);
        return ResultDTO.success(commandResult);
    }

    @Override
    public ResultDTO<CommandBean> control(CommandBean command, String stateIdentifier) throws Exception {
        final CommandBean commandResult = this.collectorService.control(command);
        return ResultDTO.success(commandResult);
    }

}
